package com.domino.hacettepeadisyon;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class MainActivity extends Activity {

	private String[] Masalar = 
	    {"Masa 1", "Masa 11", "Masa 21", "Masa 31","Masa 41",
	        "Masa 51", "Masa 61", "Masa 71", "Masa 81", "Masa 91", "Masa 10",
	        "Masa 12", "Masa 13", "Masa 14", "Masa 15", "Masa 16",
	        "Masa 17", "Masa 18", "Masa 19"};
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
    Button YeniAdisyon = (Button) findViewById(R.id.btnDevam) ;
    ListView MasaListesi  = (ListView) findViewById(R.id.listViewAdisyon);
    
    ArrayAdapter<String> veriAdaptoru = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, Masalar);
    MasaListesi.setAdapter(veriAdaptoru);
    
    MasaListesi.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,
				long id) {
			
			startActivity(new Intent("view.holder.SilDegistir"));
			
		}
    	
	});
    
    
        YeniAdisyon.setOnClickListener(new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			startActivity(new Intent("view.holder.MasaKayit"));
			
		}
		
	});
    }   

}
